Welcome to Solarduino , A blog about DIY Solar PV and Arduino projects

How to get Real Time Cloak from Blynk app without RTC Module for NodeMCU

TIME relativity is a very important parameter for action accuracy.  Every micro controller has a built in duration counter to count time lapse during the board start up. During programming, most of the time we do action by duration counting and comparison but not related with our local clock timing. For example, we can command the NodeMCU to turn ON Lights every 3 hours but the timing for operation is relatively to its startup time which is not dependent to our local or clock time. 

By default the Arduino and NodeMCU does not know what is our time now unless we add a Real Time Clock (RTC) module to it. The RTC module normally will get time from our PC or laptop during the uploading program to the board. It will have its own memory storage and battery to store the time memory for few years. However, once we take out or replace the battery, the memory will be lost and we need to re-upload the code to the NodeMCU to let the RTC module read from the PC and Laptop again.

There are so many practical application related to our time. The first example would be Smart Home Automation which tells the NodeMCU to turn off or turn ON certain loads at a very specific time such as 7:30pm everyday. Second example would be adding the time function code with an energy meter so that it can provide extra information such as daily / monthly or yearly energy consumption. You can use time function to rotate the Solar Tracking System without the need of local photo sensors. There are still many applications out there that requires operation with relative to our local time.

 

NodeMCU micro-controller

The NodeMCU micro-controller is similar to Arduino micro-controller board. It is compatible with Arduino IDE software and is built-in with the ESP8266 module which can be connected to the internet. You can grab some at our affiliate link here !!!  

Node MCU Micro controller Base

The based below the Node MCU can provide more flexibility on the connection ports to support more sensors. Besides, it also has 12V input port and able to provide 5V power supply to support the sensors. Support us by purchase it from our affiliate link here !!!

Before going further, let us recall the traditional way of using Real Time Clock (RTC) module. It can be a module or a Shield. Shield is normally applies to Arduino UNO while module can be applied to any micro controller boards. Although Real Time Cloak (RTC) hardware always comes separately from Micro Controller Board, but they are cheap to own. It requires some programming and wiring to make it work. 

The RTC module normally would be required especially for data logging. Thus there is a Data Logging Shield especially designed for Arduino UNO board. It has a SD Card for storage and a RTC  makes the datalogging possible. For more information about the module and Shield, you can have a look on my previous post here .

Datalogger Shield

If you plan to record the data in a proper way, you may consider this Datalogger Shield. It allows your arduino to record your data in SD Card. Datalogger shield is often installed together with LCD Display shield. Please find it at our affiliate link here !!! 

RTC Module DS3231

This is one of the reliable and low cost RTC module for arduino. You can get it from our affiliate link here !!!

Okay, let’s straight to the point. Today’s post is about how to use NodeMCU to obtain Real Time Clock function from Blynk Server so that you don’t need to have an extra RTC module and extra wiring. Blynk server and App generously offers micro controllers all around the world to read the Local Time from its server. In this way, if you have the micro controller with internet connection to Blynk server, technically we can save some cost and wiring on RTC which is an added advantage of using Blynk App (unless you don’t need this extra feature).

Hardware Wiring

You do not need to add any wiring to your NodeMCU. The NodeMCU will communicate with the Blynk Server to obtain the local time information for further programming. All the codes are taken care of. You need to focus only the Software part.

Ferrule Lugs and Crimper Set

Ferrule lugs are used at terminals for tight and secure connection. Besides, it also prevent stranded cables accidentally touching adjacent power line that may cause short circuit. Grab 1 at our affiliate link here !!!

Blynk App – The Online Data Monitoring Platform

Blynk is a user friendly platform that provide web interface for data display. It provide smart phone app for easy setup and monitoring. In the app, there are a lot of Widget Boxes which suits a lot of measurement data. However, if you want to use the Widgets, it will consume energies based on the Widget types, similar to online games that you may need to top up the energy when you require more widgets. Upon creating an account, there will be some energy which should be enough for small project.

Download Blynk App on Google Play
Download Blynk App on App Store

Wireless Smart Energy Monitor for Saving

This is an energy meter for the whole household monitoring and the measurement unit is fit inside electrical panel while there is a portable monitor display which is constantly communicate and acquire data via wireless with the measurement transmitter unit. You can get it at our affiliate link here !!!

Software Step By Step Guideline

The software part will be divided into 2 parts: 1) the smart phone web interface Blynk App and the 2) programming part using Arduino IDE Software.

On phone 

  1. Download Blynk App on your smart phone (Google Play / AppStore).
  2. Open and create an Account on Blynk App.
  3. Add New Project 
  4. Blynk will send a Auth Token to your email specifically for this project.
  5. At your project main page, swap to the right to open Widget Box.
  6. Add Widgets : Value Display Widgets & Real-time Clock Widget

Widget settings : 

Virtual pin V1 = Display Time Value

Virtual pin V2 = Display Date Value

 

On Laptop / PC

  1. Install Arduino IDE Programming Software (If you do not have the software, click here to download)
  2. Install NodeMCU Board Manager for using Node MCU in Arduino IDE Programming Software (see below section)
  3. Install NodeMCU ESP8266 Library for using Wifi programming codes in Node MCU (see below section).
  4. Install Blynk Library for enable the Node MCU using Blynk server (see below section)
  5. Install Time Library for time related programming codes. (see below section)
  6. Copy Auth Token from the email, note down the Wifi name & password.
  7. Upload the code to Node MCU Board. 

Arduino Starter Kit

It is a complete set which include most of the components you need to start Arduino Projects. Kindly support us by grabbing one set at our affiliate link here !!!

Install Node MCU Board Manager 

If this is the first time you are dealing with NodeMCU, you need to add NodeMCU board manager file into the IDE software so that the software can support the Node MCU board. To add the Support File, open Arduino IDE Software, go to files>preferences>Additional Boards Manager URLs, paste this link http://arduino.esp8266.com/stable/package_esp8266com_index.json to the black space and click OK. Go to Tool > Board > make sure the board is showing NodeMCU 1.0 (ESP-12E module).

Wi-Fi Smart Energy Monitoring Control Meter

This is a smart household energy meter that could monitor and controlled by phone anywhere around the world at anytime. This is for single phase household and installed in electric panel via din rail. Get it at our affiliate link here !!!

Install ESP8266 Wifi Library

If this is the first time you are dealing with Wifi programming, this ESP8266 Wifi Library file is needed to be installed to the Arduino IDE Software so that it can understand the programming function. Go to Tools > Boards > Boards Manager and download the ESP8266 library by ESP8266 Community

Install Blynk Library

If this is the first time you are dealing with Blynk server, this Blynk Library file is needed to be installed to the Arduino IDE Software so that it can understand the programming function. Go to Tools > Boards > Boards Manager and download the Blynk library by Volodymyr Shymanskyy

100Wp Solar Panels

100Wp 18Vmp Solar Panel is commonly used for Solar DC direct and small Solar Off-Grid PV System. A good solar panel may last at least 20 years. Grab one at our affiliate link here !!!

Install Time Library

In order to do programming codes related to Real Time Clock, you need to install the Time Library. You can download the .zip file here which I also downloaded from Github. Kindly download the .zip file on desktop. To download the Time Library file, open the Arduino IDE Software. Go to Sketch > Include Library > Add .Zip Library > Select the Downloaded Time-master.zip file. That’s it.

The smart phone Blynk app and Arduino IDE software are two independent parties. As long as you do it right, the Node MCU board should be able to send data to the Blynk server so that you can see the values from your smart phone. One of the advantage of using Blynk is that the Blynk server can allow for data storage so that you can trace or download previous record. All the hard part have been done, all you need is just following the instruction and it should work well. You can customize your web interface at Blynk App. Below is one of the example how it would look like.

Before we end, we would like to give gratitude to you for taking the time to read the post. We would need readers like you to support us in order to keep growing. You can support us in the following ways :

Donate & Fund Raising

If you like my work, please send me a donation to encourage me to do more. Thanks

Aliexpress Affiliate

We are the member of Aliexpress affiliate marketing. Do support us by clicking the affiliate product links if you do wish to purchase them.

Like and Share

If you like our post, we need your support to like and share our posts or videos so that it can reach more and more people like you !!

RTC From Blynk Server using nodeMCU.ino